package web.java.a_Filter;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Demo03_Forward extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		System.out.println("demo03");
		/**
		 * 关于拦截器拦截规则
		 * 1、首先是url-pattern拦截，这里的拦截方式和Servlet匹配拦截相同
		 * 2、在url-pattern拦截之后，可以对指定url进行拦截，相当于二次拦截
		 * */
		//转发到index.jsp
		request.getRequestDispatcher("index.jsp").forward(request,response);
		//request.getRequestDispatcher("Demo04_Forward.do").forward(request,response);
	}

}
